import request from '@/utils/request'

export function list() {
  return request({
    url: '/api/pajx/product/list',
    method: 'post',
    data: {}
  })
}

export function save(form) {
  return request({
    url: '/api/pajx/product/save',
    method: 'post',
    data: {
      product_name: form.product_name,
      product_desc: form.product_desc,
      tel_num: form.tel_num,
      att_m1_num: form.att_m1_num,
      att_active_num: form.att_active_num,
      att_passive_num: form.att_passive_num,
      att_led_num: form.att_led_num,
      att_face_num: form.att_face_num,
      att_gate_num: form.att_gate_num,
      att_accessibility_num: form.att_accessibility_num,
      camera_num: form.camera_num,
      meal_num: form.meal_num,
      biz_type: form.biz_type
    }
  })
}

export function update(form) {
  return request({
    url: '/api/pajx/product/update',
    method: 'post',
    data: {
      product_id: form.product_id,
      product_name: form.product_name,
      product_desc: form.product_desc,
      tel_num: form.tel_num,
      att_m1_num: form.att_m1_num,
      att_active_num: form.att_active_num,
      att_passive_num: form.att_passive_num,
      att_led_num: form.att_led_num,
      att_face_num: form.att_face_num,
      att_gate_num: form.att_gate_num,
      att_accessibility_num: form.att_accessibility_num,
      camera_num: form.camera_num,
      meal_num: form.meal_num,
      biz_type: form.biz_type
    }
  })
}

export function disable(product_id) {
  return request({
    url: '/api/pajx/product/disable',
    method: 'post',
    data: {
      product_id: product_id
    }
  })
}

export function enable(product_id) {
  return request({
    url: '/api/pajx/product/enable',
    method: 'post',
    data: {
      product_id: product_id
    }
  })
}
